package com.hehua.AbstractFacadePattern;

public class NewEncryptFacade extends AbstractEncryptFacade {
    private FileReader reader;
    private FileWriter fileWriter;
    private NewCipherMachine cipher;

    public NewEncryptFacade() {
        reader = new FileReader();
        fileWriter = new FileWriter();
        cipher = new NewCipherMachine();
    }

    @Override
    public void fileEncrypt(String fileNameSrc, String fileNameDes) {
        String read = reader.read(fileNameSrc);
        String encrypt = cipher.encrypt(read);
        fileWriter.write(encrypt, fileNameDes);
    }
}
